using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;

using TImport = ProjectNoClue.Part;

namespace ProjectNoClue.Pipeline
{
	[ContentImporter(".part", DisplayName = "Part Importer", DefaultProcessor = "Part Processor")]
	public class PartImporter : ContentImporter<TImport>
	{
		public override TImport Import(string filename, ContentImporterContext context)
		{
			XmlSerializer xs = new XmlSerializer(typeof(TImport));
			FileStream fs = new FileStream(filename, FileMode.Open);

			TImport res = (TImport)xs.Deserialize(fs);
			fs.Close();

			return res;
		}
	}
}
